#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int a[20];
//int temp[20];
int judge(int s,int e)
{
	int cnt;
	for(int i = s;i<=e;i++)
	{
		if(i==s) cnt = 1;
		else 
		{
			if(a[i]>=a[i-1]) cnt++;
		}
	}
	//printf("%d %d\n",s,e);
	//printf("%d\n",cnt);
	if(cnt==e-s+1) return cnt;
	else 
	{
		int mid = (s+e)>>1;
		int ans1 = judge(s,mid);
		int ans2 = judge(mid+1,e);
	//	printf("%d %d\n",ans1,ans2);
		int ans = max(ans1,ans2);
		return ans;
	}
}
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		for(int i = 1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		int ans = judge(1,n);
		printf("%d\n",ans);
	}

} 
